package com.water.app.Impl.account;

import com.water.app.Constant;
import com.water.app.User;
import com.water.app.interfaces.account.userService;
import com.water.app.mapper.userMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userServiceImpl implements userService {
    @Autowired
    private userMapper userMapper;
    @Override
    public boolean updateUserMsg(User user) {
        Integer userId = Constant.THREAD_LOCAL.get();
        return userMapper.updateUserMsg(user,userId)>0;
    }

    @Override
    public boolean updateUserPicture(String picture, Integer userId) {
        return userMapper.updateUserPicture(picture,userId)>0;
    }

    @Override
    public List<User> selectUserListByUserId(List<Integer> chatUserIds) {
        return userMapper.selectUserListByUserId(chatUserIds);
    }

    @Override
    public User selectUser(Integer userId) {
        return userMapper.selectUser(userId);
    }

    @Override
    public int selectIsManager(Integer userId) {
        return userMapper.selectIsManager(userId);
    }
}
